/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rtech.billing.pdf.conversion;

import com.itextpdf.text.pdf.PdfPageEventHelper;
import com.rtech.billing.property.Constants;
import com.rtech.billing.property.PropertiesManager;

/**
 *
 * @author rattank
 */
public abstract class PDFGenerator extends PdfPageEventHelper {
    
    public abstract String createPDF(String fileName , String fileContent , boolean headerRequired);

        protected String getHeaderElement() {
        StringBuffer  heardString = new StringBuffer("");  ;
        heardString.append("<table style='width: 100%;font-size:8pt;' border='0'>");
        heardString.append("<tbody>");
        heardString.append("<tr>");
        heardString.append("<td style='width: 20%;' align='left' valign='top'><img ");
        heardString.append("src='"+PropertiesManager.getInstance().getPropertyValue(Constants.PROPERTY_HEADER_LOGO_FILE)+"'");
        heardString.append("width='150pt' height='100pt' /></td>");
        heardString.append("<td style='width: 40%;'>&nbsp;</td>");
        heardString.append("<td style='width: 20%;' align='left' valign='top'>");
        heardString.append("<table style='hight: 50%;' border='0' cellspacing='0' cellpadding='0'>");
        heardString.append("<tbody>");
        heardString.append("<tr>");
        heardString.append("<td style='width: 100%;' align='left' valign='top'>");
        heardString.append(PropertiesManager.getInstance().getPropertyValue(Constants.PROPERTY_HEADER_TEXT_LINE1));
        heardString.append("</td>");
        heardString.append("</tr>");
        heardString.append("<tr>");
        heardString.append("<td style='width: 100%;' align='left' valign='top'>");
        heardString.append(PropertiesManager.getInstance().getPropertyValue(Constants.PROPERTY_HEADER_TEXT_LINE2));
        heardString.append("</td>");
        heardString.append("</tr>");
        heardString.append("<tr>");
        heardString.append("<td style='width: 100%;' align='left' valign='top'>");
        heardString.append(PropertiesManager.getInstance().getPropertyValue(Constants.PROPERTY_HEADER_TEXT_LINE3));
        heardString.append("</td>");
        heardString.append("</tr>");
        heardString.append("<tr>");
        heardString.append("<td style='width: 100%;' align='left' valign='top'>");
        heardString.append(PropertiesManager.getInstance().getPropertyValue(Constants.PROPERTY_HEADER_TEXT_LINE4));
        heardString.append("</td>");
        heardString.append("</tr>");
        heardString.append("</tbody>");
        heardString.append("</table>");
        heardString.append("</td>");
        heardString.append("</tr>");
        heardString.append("<tr>");
        heardString.append("<td>Reference No __________</td>");
        heardString.append("<td>&nbsp;</td>");
        heardString.append("<td>Date __________</td>");
        heardString.append("</tr>");
        heardString.append("<tr>");
        heardString.append("<td>&nbsp;</td>");
        heardString.append("<td>&nbsp;</td>");
        heardString.append("<td>&nbsp;</td>");
        heardString.append("</tr>");
        heardString.append("</tbody>");
        heardString.append("</table>");
        return heardString.toString();
    }

}
